export function uploadVideo(formData){
	return new Promise((resolve,reject)=>{
		uni.chooseVideo({
			success(chooseImageRes){
				// resolve(chooseImageRes.tempFilePaths[0]);
				const tempFilePaths = chooseImageRes.tempFilePath;
				 // localStorage.getItem('token');
				const token = uni.getStorageSync('token')
				uni.showLoading({
					title: '请稍后..',
					mask: true,
				})
				uni.uploadFile({
					url:config.uploadImgUrl,
					filePath: tempFilePaths,
					name: 'file',
					formData:formData,
					header: {
						'token':token,
					},
					success:(res)=>{
						//需要JSON.parse
						// console.log('upload res---',res);
						let data = JSON.parse(res.data);
						if(!data || data.code !== 1 ){
							msg('上传失败');
							reject();
							return;
						}
						//即为全路径地址fullurl,url
						resolve(data.data.fullurl);
					},
					fail:(err)=>{
						// console.log('err--',err);
						// this.$tools.msg(JSON.stringify(err));
						msg('上传失败');
						reject();
					},
					complete:()=> {
						uni.hideLoading();
					},
				})
			},
			fail(err){
				// msg('打开相册失败');
				reject(err)
			}
		})
	})
}